﻿@{      
    string status = String.Empty;
    if(JDM.HasFlags(Model.Flags, "Voided"))
    {
        status = "Voided";
    }
    else if(JDM.HasFlags(Model.Flags, "Refunded"))
    {
        status = "Refunded";
    }
    else if(JDM.HasFlags(Model.Flags, "Pending"))
    {
        status = "Pending";
    }
    else if(JDM.HasFlags(Model.Flags, "Authorized"))
    {
        status = "Authorized";
    }
    else if(JDM.HasFlags(Model.Flags, "Captured"))
    {
        status = "Captured";
    }
}

<div class="box unit-overview payment">
    <header>
        <h4>@T(Res.Name("Payment"), 
            JDM.Int32(Model.EntityID), 
            Svc.Date((DateTime)JDM.DateTime(Model.CreatedOn)), 
            T(Res.In("API").Of("Enum").Of("PaymentFlags").Name(status)))</h4>
    </header>
    <section>
        <div class="hint">
            <p>@T(Res.Name(status))</p>
        </div>
        <table class="key-value highlight-key">
            <tr>
                <td>@T(Res.In("Common").Of("Vocab").Name("Guid"))</td>
                <td>@JDM.String(Model.Guid)</td>
            </tr>
            <tr>
                <td>@T(Res.Name("HandlingFee"))</td>
                <td>@Svc.Price((decimal)JDM.Decimal(Model.HandlingFee))</td>
            </tr>
            <tr>
                <td>@T(Res.Name("Amount"))</td>
                <td>@Svc.Price((decimal)JDM.Decimal(Model.Amount))</td>
            </tr>
        </table>
    </section>
</div>